package com.hongyi.common.framework.validate.custom;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 密码格式自定义校验注解
 *
 * @author DingHao
 */

@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = PasswordValidator.class)
public @interface ValidPassword {

    String message() default "密码必须包含小写字母、大写字母、数字和特殊字符，并且长度为8位";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
